﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using V5_Common;
using V5_Model;
using V5_BLL;

namespace V5_EShop._Template.Default
{
    public partial class Shopping_pay : BasicPage
    {
        public int addressid = 0;
        public ModelUserToArea area = new ModelUserToArea();

        protected override void OnInit(EventArgs e)
        {
            this.btnSaveGoOrder.Click += new EventHandler(btnSaveGoOrder_Click);
            base.OnInit(e);
        }

        void btnSaveGoOrder_Click(object sender, EventArgs e)
        {
            int payid = 0;
            int sendid = 0;
            if (rbtnpay1.Checked)
            {
                payid = 1;
            }
            else if (rbtnpay2.Checked)
            {
                payid = 2;
            }
            else if (rbtnpay3.Checked)
            {
                payid = 3;
            }
            else if (rbtnpay4.Checked)
            {
                payid = 4;
            }
            else if (rbtnpay5.Checked)
            {
                payid = 5;
            }
            else if (rbtnpay6.Checked)
            {
                payid = 6;
            }

            if (rbtnDelivery1.Checked)
            {
                sendid = 1;
            }
            else if (rbtnDelivery2.Checked)
            {
                sendid = 2;
            }
            else if (rbtnDelivery3.Checked)
            {
                sendid = 3;
            }
            else if (rbtnDelivery4.Checked)
            {
                sendid = 4;
            }
            Response.Redirect("/Shopping_Order.aspx?addressid=" + area.id + "&payid=" + payid + "&sendid=" + sendid);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            addressid = Input.SetInt(Request["addressid"]);
            if (addressid > 0)
            {
                area = new BLLUserToArea().GetModel(addressid);
            }
        }
        //绑定送货地址
        private void Bind_rpAreaList()
        {

        }
    }
}
